package com.ygqh.baby.mapper;

import com.ygqh.baby.ao.QueryInfo;
import com.ygqh.baby.model.AdminPurchaseDetailInCount;
import com.ygqh.baby.po.AdminContractArrive;
import com.ygqh.baby.po.AdminPurchase;
import com.ygqh.baby.po.AdminPurchaseExample;

import java.util.Date;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

public interface AdminPurchaseMapper {
	int countByExample(AdminPurchaseExample example);

	int deleteByExample(AdminPurchaseExample example);

	int deleteByPrimaryKey(Long id);

	int insert(AdminPurchase record);

	int insertSelective(AdminPurchase record);

	List<AdminPurchase> selectByExample(AdminPurchaseExample example);

	AdminPurchase selectByPrimaryKey(Long id);

	int updateByExampleSelective(@Param("record") AdminPurchase record, @Param("example") AdminPurchaseExample example);

	int updateByExample(@Param("record") AdminPurchase record, @Param("example") AdminPurchaseExample example);

	int updateByPrimaryKeySelective(AdminPurchase record);

	int updateByPrimaryKey(AdminPurchase record);

	List<AdminPurchase> selectSuper(@Param("queryInfo") QueryInfo queryInfo, @Param("q") String q, @Param("startDate") Date startDate,
			@Param("endDate") Date endDate, @Param("purchaseCode") String purchaseCode,@Param("contractCode")  String contractCode);

	int countSuper(@Param("q") String q, @Param("startDate") Date startDate, @Param("endDate") Date endDate, @Param("purchaseCode") String purchaseCode,  @Param("contractCode") String contractCode);

	AdminPurchase selectPurchaseByCode(String purchaseCode);

	List<AdminContractArrive> selectContractArriveReport(@Param("queryInfo") QueryInfo queryInfo, @Param("skuCode") String skuCode,
			@Param("supplierName") String supplierName, @Param("contractCode") String contractCode, @Param("startDate") Date startDate,
			@Param("endDate") Date endDate);

	int countArrive(@Param("skuCode") String skuCode, @Param("supplierName") String supplierName, @Param("contractCode") String contractCode,
			@Param("startDate") Date startDate, @Param("endDate") Date endDate);

	List<Map<String, Object>> selectDetailList(@Param("skuCode") String skuCode, @Param("contractCode") String contractCode);

	List<AdminPurchase> selectPurchaseByContractCode(@Param("contractCode") String contractCode);

	List<AdminPurchase> selectPurchase(@Param("q") String q, @Param("purchaseCode") String purchaseCode);
}